import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BizStationHardwareVo } from './types';

/**
 * 查询列表
 * @param query
 * @returns {*}
 */

export const listHardware = (query?: PageQuery): AxiosPromise<BizStationHardwareVo[]> => {
  return request({
    url: '/biz-station/stationHardware/list',
    method: 'get',
    params: query
  });
};
/**
 * 导出列表
 * @param query
 * @returns {*}
 */

export const exportHardware = (query?: PageQuery): AxiosPromise<BizStationHardwareVo[]> => {
  return request({
    url: '/biz-station/stationHardware/export',
    method: 'post',
    params: query
  });
};

/**
 * 查询详细
 * @param id
 */
export const getHardware = (id: string | number): AxiosPromise<BizStationHardwareVo> => {
  return request({
    url: '/biz-station/stationHardware/' + id,
    method: 'get'
  });
};


/**
 * 新增
 * @param data
 */
export const addHardware = (data: BizStationHardwareVo) => {
  return request({
    url: '/biz-station/stationHardware',
    method: 'post',
    data: data
  });
};

/**
 * 修改
 * @param data
 */
export const updateHardware = (data: BizStationHardwareVo) => {
  return request({
    url: '/biz-station/stationHardware',
    method: 'put',
    data: data
  });
};

/**
 * 删除
 * @param id
 */
export const delHardware = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz-station/stationHardware/' + id,
    method: 'delete'
  });
};
